<!doctype html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/login.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="./js/jquery.cookie.js"></script>
    <script src="./lib/layui/layui.js" charset="utf-8"></script>
    <script src="./js/base.js"></script>
    <script src="./js/e.js"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        body {
            background: url(./images/bg.jpg) no-repeat !important;
            background-size: 100% 100% !important;
        }

        .layui-form-radio {
            margin: 0 !important;
            padding: 0 !important;
            color: #3DB6FE !important;
        }

        .layui-form-checked[lay-skin=primary] i {
            background: #3DB6FE !important;
        }

        .layui-form-checkbox[lay-skin=primary]:hover i {
            border-color: #3DB6FE !important;
        }

        .login.layui-anim #darkbannerwrap {
            margin-bottom: 0;
        }
    </style>
</head>

<body class="login-bg">

<div class="login layui-anim layui-anim-up">
    <div class="message">账号关联</div>
    <div id="darkbannerwrap"></div>
    <div style="margin-bottom: 25px;font-size: 14px;text-align: center;line-height: 30px;">
        您的帐号尚未关联，请输入山东省足球运动协会网站的账户密码进行关联，如果未注册，点击进行注册
    </div>
    <form method="post" action="#" class="layui-form">
        <div style="position: relative;">
            <i class="layui-icon"
               style="position: absolute;left:10px;line-height:50px;font-size:24px;color:#3DB6FE;">&#xe66f;</i>
            <input name="adminName" id="user_name" placeholder="请输入用户名" style="text-indent:24px" type="text"
                   autocomplete="off" lay-verify="required" class="layui-input">
        </div>
        <hr class="hr15">
        <div style="position: relative;">
            <i style="position: absolute;left:10px;line-height:50px;font-size:24px;color:#3DB6FE;"
               class="layui-icon">&#xe673;</i>
            <input name="password" id="pass" style="text-indent:24px" lay-verify="required" placeholder="请输入密码"
                   autocomplete="off" type="password" class="layui-input">
        </div>
        <hr class="hr15">
        <input value="关联" lay-submit lay-filter="login" style="width:100%;background-color: #3DB6FE!important;"
               type="submit">
        <!--            <a href="#" style="top: 10px;position: relative;color: #3DB6FE;font-size: 14px;float: right;">忘记密码？</a>-->
    </form>
</div>
<script>
    $(function () {

        layui.use('form', function () {
            var form = layui.form;
            // layer.msg('玩命卖萌中', function(){
            //   //关闭后的操作
            //   });
            //监听提交
            form.on('submit(login)', function (data) {
                // alert(888)
                console.log(data.field) //输出提交的信息
                $.ajax({
                    url: relationTel,
                    data: {
                        userTel: data.field.adminName,
                        password: data.field.password
                    },
                    dataType: 'json',
                    type: 'get',
                    success: function (res) {
                        //seccess？href跳转：alert(msg)\
                        console.log(res)

                        if (res.msg == "0") {
                            location.href = "index.html";
                        } else {
                            layer.msg(res.msg);
                        }
                    },
                    error: function (error) {
                        console.log(error)
                    }
                })
                return false;
            });

            form.verify({
                // pass:function(){
                //     var reg = /^[\w]{6,12}$/;
                //     if (!($('#pass').val().match(reg))) {
                //         //layer.msg('请输入合法密码');
                //         layer.msg('请输入合法密码');
                //     }
                // }
            })
        });
    })
</script>
</body>

</html>